/**
 * 上传文件
 * @param file 要上传的对应文件
 */
function upload(file, callback) {
    if (file == null) {
        console.log("上传文件为空");
        return;
    }
    let formData = new FormData();
    formData.append('file', file);
    $.ajax({
        url: "/common/upload",
        type: 'post',
        cache: false,
        data: formData,
        processData: false,
        contentType: false,
        dataType: "json",
        success: function(result) {
            callback(result);
        }
    });

}